public class ThreadGroupMain {

	public static void main(String[] args) {

		new PrintNameThread("A");

		new PrintNameThread("B");

		new PrintNameThread("C");

		ThreadGroup threadGroup = Thread.currentThread().getThreadGroup();
		
		Thread[] list = new Thread[threadGroup.activeCount()];
		threadGroup.enumerate(list);
		
		for (Thread thread : list) {
			System.out.println("Thread " + thread+ "in the group" + threadGroup.getName());
		}
	}

}
